﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Funkcje
{
    public class Wezly
    {
        public List<Wezel> ListaWezlow { get; set; }


        public Wezly()
        {
            this.ListaWezlow = new List<Wezel>();
        }

        public void wczytaj(string sciezka)
        {
            string[] linieWezlow = File.ReadAllLines(sciezka);
            foreach (var linia in linieWezlow)
            {
                string[] dane = linia.Split('#');
                ListaWezlow.Add(new Wezel(Convert.ToDouble(dane[0]), Convert.ToDouble(dane[1])));
            }
        }

        public override string ToString()
        {
            StringBuilder str = new StringBuilder();
            foreach (var wezel in ListaWezlow)
            {
                str.Append(wezel.ToString());
                str.Append("\n");
            }
            return str.ToString();
        }
    }
}
